package com.note.simpleshop.module.cart.vo;

import com.note.simpleshop.entity.TbCart;
import com.note.simpleshop.module.goods.vo.GoodsSpecVo;
import com.note.simpleshop.module.goods.vo.GoodsVo;

import java.math.BigDecimal;
import java.util.Date;

public class CartVo {
    private String id;
    private String goodsId;
    private String goodsSpecId;
    private String userId;
    private Integer num;
    private Date addTime;
    private BigDecimal price;
    private Integer isDelete;
    //商品基本信息
    private GoodsVo goods;
    //商品规格信息
    private GoodsSpecVo goodsSpec;

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsSpecId() {
        return goodsSpecId;
    }

    public void setGoodsSpecId(String goodsSpecId) {
        this.goodsSpecId = goodsSpecId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public GoodsVo getGoods() {
        return goods;
    }

    public void setGoods(GoodsVo goods) {
        this.goods = goods;
    }

    public GoodsSpecVo getGoodsSpec() {
        return goodsSpec;
    }

    public void setGoodsSpec(GoodsSpecVo goodsSpec) {
        this.goodsSpec = goodsSpec;
    }
    public static CartVo newInstance(TbCart cart)
    {
        CartVo vo=new CartVo();
        vo.id=cart.getId();
        vo.goodsId=cart.getGoodsId();
        vo.goodsSpecId=cart.getGoodsSpecId();
        vo.userId=cart.getUserId();
        vo.addTime=cart.getAddTime();
        vo.num=cart.getNum();
        vo.price=cart.getPrice();
        return vo;
    }
}
